<template>
  <div class="user-address-info">
    <div v-if="!cartStore.defaultAddress"
         class="empty">
      您需要先添加收货地址才可提交订单。
    </div>
    <div v-else
         class="address">
      <address-info :data="cartStore.defaultAddress"/>
    </div>
  </div>
</template>

<script lang="ts"
        setup>
import {useCartStore} from '@/stores/cart'
import AddressInfo from '@/views/cart/pay/components/AddressInfo.vue'

let cartStore = useCartStore()
</script>

<style lang="less"
       scoped>
.user-address-info {
  min-height: 90px;
  display: flex;
  align-items: center;

  .empty {
    margin-left: 20px;
    color: #999999;
    justify-content: center;
  }

  .address {
    margin: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
</style>